package com.eating8.base.context;

import javax.servlet.ServletContextEvent;

import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.WebApplicationContextUtils;


public class SpringContextLoaderListener extends ContextLoaderListener {

	//public static final Logger log = Logger.getLogger(SpringContextLoaderListener.class);

	@Override
	public void contextInitialized(ServletContextEvent event) {
		// 调用父类的初始化方法
		super.contextInitialized(event);

		SpringLocator.setApplicationContext(WebApplicationContextUtils.getRequiredWebApplicationContext(event.getServletContext()));
		//log.info("succeed to set application context to spring locator.");
	}
}
